.class Lcom/waiqin365/base/login/cs;
.super Ljava/lang/Thread;


# instance fields
.field final synthetic a:Lcom/waiqin365/base/login/LoginMainActivity;

.field private b:Landroid/os/Handler;


# direct methods
.method public constructor <init>(Lcom/waiqin365/base/login/LoginMainActivity;Landroid/os/Handler;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/base/login/cs;->a:Lcom/waiqin365/base/login/LoginMainActivity;

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    iput-object p2, p0, Lcom/waiqin365/base/login/cs;->b:Landroid/os/Handler;

    return-void
.end method

.method private a(Z)V
    .locals 2

    new-instance v0, Landroid/os/Message;

    invoke-direct {v0}, Landroid/os/Message;-><init>()V

    if-eqz p1, :cond_1

    const/16 v1, 0x12d

    iput v1, v0, Landroid/os/Message;->what:I

    :goto_0
    iget-object v1, p0, Lcom/waiqin365/base/login/cs;->b:Landroid/os/Handler;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/waiqin365/base/login/cs;->b:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    :cond_0
    return-void

    :cond_1
    const/16 v1, 0x12c

    iput v1, v0, Landroid/os/Message;->what:I

    goto :goto_0
.end method


# virtual methods
.method public run()V
    .locals 5

    const/4 v2, 0x0

    :try_start_0
    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->groupManager()Lcom/hyphenate/chat/EMGroupManager;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMGroupManager;->getJoinedGroupsFromServer()Ljava/util/List;

    move-result-object v3

    move v1, v2

    :goto_0
    invoke-interface {v3}, Ljava/util/List;->size()I

    move-result v0

    if-ge v1, v0, :cond_0

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->groupManager()Lcom/hyphenate/chat/EMGroupManager;

    move-result-object v4

    invoke-interface {v3, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/EMGroup;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMGroup;->getGroupId()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v4, v0}, Lcom/hyphenate/chat/EMGroupManager;->getGroupFromServer(Ljava/lang/String;)Lcom/hyphenate/chat/EMGroup;

    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_0

    :cond_0
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/waiqin365/base/login/cs;->a(Z)V
    :try_end_0
    .catch Lcom/hyphenate/exceptions/HyphenateException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_1
    return-void

    :catch_0
    move-exception v0

    invoke-direct {p0, v2}, Lcom/waiqin365/base/login/cs;->a(Z)V

    invoke-virtual {v0}, Lcom/hyphenate/exceptions/HyphenateException;->printStackTrace()V

    goto :goto_1
.end method
